import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/index'
    },
    // 首页
    {
      path: '/index',
      component: resolve => require(['@/views/home.vue'], resolve),
      children: [{
        path: '/index',
        component: resolve => require(['@/views/index.vue'], resolve),
      },
      // 项目案例
      {
        path: '/project-case',
        component: resolve => require(['@/views/project-case.vue'], resolve),
      },
      // 服务团队
      {
        path: '/service-team',
        component: resolve => require(['@/views/service-team.vue'], resolve),
      },
      // 公司动态
      {
        path: '/company-dynamics',
        component: resolve => require(['@/views/company-dynamics.vue'], resolve),
      },
      // 关于欧点
      {
        path: '/about',
        component: resolve => require(['@/views/about.vue'], resolve),
      },
      // 联系我们
      {
        path: '/contact',
        component: resolve => require(['@/views/contact.vue'], resolve),
      },
      // 合作伙伴
      {
        path: '/cooperative-partner',
        component: resolve => require(['@/views/sub_page/cooperative-partner.vue'], resolve),
      },
      // 公司招聘
      {
        path: '/recruit',
        component: resolve => require(['@/views/sub_page/recruit.vue'], resolve),
      },
      // 公司环境
      {
        path: '/environment',
        component: resolve => require(['@/views/sub_page/environment.vue'], resolve),
      },
      // 案例详情
      {
        path: '/case-details',
        component: resolve => require(['@/views/sub_page/case-details.vue'], resolve),
      },
      // 公司资质
      {
        path: '/company-qualification',
        component: resolve => require(['@/views/sub_page/company-qualification.vue'], resolve),
      },
      // 业务介绍
      {
        path: '/business-introduction',
        component: resolve => require(['@/views/sub_page/business-introduction.vue'], resolve),
      }]
    }
  ],
  scrollBehavior (to, from, savedPosition) {
      return { x: 0, y: 0 }
  }
})
